1. Field of the Invention
This invention relates generally to optical storage media, and more particularly to methods and computer readable media for writing and reading to and from compact disc (CD) media.
2. Description of the Related Art
In recent years, compact disc (CD) recording technology has made substantial advancements that have enabled casual computer users to record all types of digital data to the CD media. As is well known, there are several types of CD media recording standards and associated media. For example, ISO-9660 (also known as ECMA-119) provides a file system for CD-ROMs. Specifically, the ISO 9660 provides a standard specifying how data shall be structured on a CD-ROM. Most platforms such as Microsoft Windows(copyright) and DOS(copyright) can read CD-ROM discs conforming to the ISO 9660.
However, the ISO 9660 standard does not provide means for changing or adding data on CD-ROMs. To overcome such limitations, the OSTA Universal Disk Format (UDF) has been created to implement ISO-13346 (also known as ECMA-167). Whereas ISO-13346 is a broad, general standard for storing information on any medium, the UDF specifically provides a standard for storing data not only on CD-ROMs but also on recordable and re-writable optical discs such as CD-Recordable (CD-R) and CD-Re-writable (CD-RW) as well as DVDs. Writing data in accordance with the UDF standard provides great flexibility in terms of transferring data between a CD medium and other storage devices, such as hard disks and floppy disks.
The CD-R and CD-RW discs differ in the manner data can be written. Specifically, CD-R disc is a write once media where data can be recorded only once over a single session or during multiple sessions. This is because the data that is digitally written to the CD-R causes a permanent change in the properties of the CD-R. This change in property is often referred to as the xe2x80x9cburningxe2x80x9d of data onto the CD.
On the other hand, data can be written and rewritten on a CD-RW disc much like a hard disk or a floppy disk. That is, data may be written to the CD-RW in fixed packet sizes and then erased and recorded again repeatedly. This is because the CD-RW, unlike CD-R, performs recording by making use of phase change materials in its recording layer. When the phase change material is irradiated by a laser beam, the data can be erased (crystal phase) and recorded (amorphous phase). Then, by way of differences in the reflectivity of either the crystal phase or amorphous phase, the data stored on the media can be read. However, data recorded on CD-RW media is typically not readable by standard CD-ROM drives.
For writing to re-writable optical media such as CD-RW discs, the UDF standard provides writing in xe2x80x9cincremental packet mode,xe2x80x9d which is well known and described in detail in UDF standards such as UDF 1.5 and 2.0, which are incorporated herein by reference. In the incremental packet mode, data is written in units of packets. The writing of data in units of small packets provides a more efficient means for writing data onto CD-RW discs. For example, before the implementation of incremental packet mode, if a data stream is interrupted while writing the data to a CD-RW disc, for example, the disc was no longer usable. In incremental packet mode writing, however, if a data stream is interrupted while writing fixed data packet to the CD-RW disc, only the interrupted packet becomes useless. In this case, new packets may be written after the interrupted packet such that the disc still contains useful data.
In general, optical discs are substantially cheaper than other mass storage media such as hard disk drives of comparable size. As a result, the optical discs are being widely used to store data for a variety of purposes. For example, the CD-RW discs are frequently used to backup hard one or more disk drives in a computer system. Additionally, the CD-RW media may be used to store custom software for distribution. The data stored in the CD-RW media may then be restored or installed on a computer system.
Restoring or installing data from optical media, however, often requires the use of a separate boot disk such as a floppy disk. For example, to restore data in a disaster recovery situation generally requires the user to insert a boot floppy disk to load an operating system before accessing the optical discs. Also, installing a custom software from a CD-RW disc often requires booting up the computer system by inserting a boot disk.
One prior art standard called xe2x80x9cEl Toritoxe2x80x9d defines a specification for a bootable CD-ROM format and is available from Phoenix Technologies and IBM. Specifically, the El Torito standard, also known as xe2x80x9cCD/OS,xe2x80x9d specifies a bootable CD-ROM format that allows a computer system to boot up from a CD-ROM, which conforms to the El Torito standard. Thus, a separate floppy boot disk is not required. The El Torito standard is well known in the art and is incorporated herein by reference.
Unfortunately, however, the El Torito standard does not provide a solution for booting up from a CD-RW media that conform with the UDF standard. In particular, the El Torito standard is not applicable to re-writable CD-RW discs that are written using incremental fixed packet writing mode. Instead, the El Torito specification is directed to providing a bootable CD-ROM only.
Additionally, CD-R discs are written using sequential writing methods such as track-at-once, session-at-once, disc-at-once, variable packet length writing, etc. In contrast, the conventional CD-RW discs can also be written using fixed length packets in addition to the various methods used for writing to the CD-R discs. This is because the CD-RW discs allows individual packets to be re-written in comparison with other methods where only complete tracks can be re-written.
FIG. 1A shows a physical layout of an exemplary CD-RW disc 100. In the CD-RW disc, a plurality of usable blocks 102 and link blocks 104 are laid out in sequence. Each of the usable blocks 102 and link blocks 104 are typically of fixed lengths. For example, each of the usable blocks 102 in which data may be written typically includes a fixed number of blocks such as 32 blocks. On the other hand, each of the link blocks 104 represents a slack space in which user data is not written and typically includes 7 blocks.
As is well known, although the link blocks 104 do not contain user data, they provide information (e.g., synchronization data, control data, etc.) necessary for proper reading of the CD-RW disc 100. Individual blocks in the usable and link blocks 102 and 104 generally include 2,048 bytes or 2 Kbytes, respectively.
In this configuration, the first usable block 102 includes 32 blocks from block B0 to block B31. Then, a link block 104 of seven blocks from block B32 to B38 follows. Following this link block 104 is another usable block 102 having blocks B39 to B70 and so on. In this manner, each of the usable blocks 102 represent a data space into which a fixed packet of data can be written.
Currently, two types of CD-RW devices are being widely used in the market: mode 1 and mode 2 devices. Mode 2 devices simply map out the bad blocks, i.e., link blocks 102, as their occurrence is deterministic. FIG. 1B illustrates a schematic diagram of a CD-RW disc 100A as seen by a mode 2 device. In this diagram, the mode 2 device skips the link blocks 104. By thus skipping the link blocks 104, the mode 2 devices reads the blocks in the usable data blocks 102 in sequence as if no link block existed. For example, the first block B32 in the second usable data block 102 is treated as the next block of the block B31 in the first usable data block 102. In this manner, the mode 2 devices read only usable data.
In contrast, mode 1 devices read every block in a CD-RW disc including both the usable data blocks 102 and link blocks 104. FIG. 1C shows a schematic diagram of a CD-RW disc 100B as seen by a mode 1 device. As shown, the mode 1 device reads every block in the usable data and link blocks 102 and 104 in sequence. For instance, the first block B32 in the first link block 104 is read immediately after the last block B31 in the first usable data block 102. In this case, an error condition is generated because the block B32 does not contain useful data.
However, when a boot image is to be written onto an optical media such as CD-RW discs that use fixed size packets, the entire boot image may not fit within a single packet. For example, a boot image of a floppy disk may be 1.44 Mbytes. In contrast, a single usable data packet is only 32 blocks, each of which is 2 Kbytes. Hence, a single data packet may contain only 64 Kbytes. Accordingly, a boot image of 1.44 Mbytes will generally be written over more than two fixed-size packets with intervening link blocks. Due to the interruption in the boot image in such cases, a computer system attempting to boot up from such boot image using a mode 1 device will typically generate an error condition, thereby preventing proper booting up of the computer system.
In view of the foregoing, there is a need for methods of writing fixed packet re-writable optical media such as CD-RW in an incremental packet mode to allow computers to boot up from these media without a dedicated boot disk.
Broadly speaking, the present invention fills these needs by providing methods and computer readable media for writing data to re-writable optical media in a fixed packet mode to allow computers to bootup without a dedicated boot disk. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, computer readable media, or a device. Several inventive embodiments of the present invention are described below.
In one embodiment, the present invention provides a method for writing fixed packet data to create a re-writable compact disc that is bootable in dual modes. Each of the fixed packets includes a set of data blocks with a set of link blocks separating a pair of consecutive fixed packets. A first packet is written onto a re-writable compact disc including a boot record that has a pair of pointers for pointing to locations of associated boot catalogs. One pointer is used to point to a location of an associated boot catalog. An emulated boot image of a source medium is created for the re-writable compact disc. For a first device that is capable of reading the link blocks, a first boot catalog is written in a second packet where the first boot catalog includes a pointer to a location of a first boot image that can be executed to boot up a computer system. For a second device that is capable of skipping the link blocks, a second boot catalog is written in the second packet where the second boot catalog includes a pointer to a location of a second boot image that can be executed to boot up the computer system. A first boot image is written to emulate the source medium having bad sectors that correspond to the locations of the link blocks in the compact disk such that reading of the first boot image is not interrupted when booting up the computer system from the first boot image. A second boot image is written without emulating the bad sectors corresponding to the locations of the link blocks in the compact disk.
In another embodiment, the present invention provides a method for writing data packet to create a bootable CD-RW disc. Each data packet includes a set of data blocks with a set of link blocks separating a pair of consecutive data packets. The method comprising: (a) writing a first packet onto a CD-RW disc including a boot record for pointing to a location of a boot catalog; (b) writing a first boot catalog for pointing to a location of a first boot image that can be executed to boot up a computer system that uses a device capable of reading the link blocks; (c) generating a boot image of a source medium for the CD-RW disc; and (d) writing the boot image as a first boot image by emulating the source medium having bad sectors that correspond to the locations of the link blocks in the compact disk such that reading of the first boot image is not interrupted when booting up the computer system from the first boot image.
In yet another embodiment, a computer readable medium having program instructions for writing fixed data packet to create a bootable optical disc is disclosed. Each data packet includes a set of data blocks with a set of link blocks separating a pair of consecutive data packets. The computer readable medium comprising: (a) program instructions for writing a first packet onto an optical disc including a boot record for pointing to locations of at least two boot catalogs; (b) for a mode 1 device that is capable of reading the link blocks, program instructions writing a first boot catalog for pointing to a location of a first boot image that can be executed to boot up a computer system that uses a mode 1 device; (c) for a mode 2 device that is capable of mapping out the link blocks, program instructions writing a second boot catalog for pointing to a location of a second boot image that can be executed to boot up the computer system that uses a mode 2 device; (d) program instructions for generating an emulated boot image of a source medium for the optical disc; (e) program instructions for writing the emulated boot image as the first boot image by emulating the source medium having bad sectors that correspond to the locations of the link blocks in the compact disk such that reading of the first boot image is not interrupted when booting up the computer system from the first boot image; and (f) program instructions for writing the emulated boot image as the second boot image without emulating the bad sectors corresponding to the locations of the link blocks in the compact disk.
Advantageously, the present invention allows computer systems to boot up directly from fixed packet random access optical discs without using a dedicated bootup disk. In addition, by taking ensuring that the bad blocks in the bootable source medium occur at the locations corresponding to link blocks, the interruptions in reading a boot image in a CD-RW disc is eliminated. Accordingly, such discs allow a computer system to boot up without interruptions. Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.